<?php

class Admin_ManageController extends Yaf_Controller_Abstract {

    private $_layout;

    public function init() {
        /* use layout */
        $this->_dispatcher = Yaf_Registry::get("dispatcher");
        $this->_layout = new LayoutPlugin('layout.phtml');
        $this->_dispatcher->registerPlugin($this->_layout);
    }

    public function IndexAction() {     
        if($_SESSION['system_type'] == '1'){
            header("Location:admin_itools");
        }
        $sign = isset($_SESSION['info']) ? $_SESSION['info'] : "";
        if (empty($sign)) {
            header("Location:../admin_login");
            exit;
        } else {
            $this->_view->info = $sign;
        }
        /* layout */
        $this->_view->title = '用户管理系统';
        $this->_layout->meta_title = '用户管理系统';
    }
    public function ItoolsAction() {
        $_SESSION['system_type'] = 0;
        header("Location:/admin_manage");
    }
    public function ManageAction() {
        $_SESSION['system_type'] = 1;
        header("Location:/admin_manage");
    }

}
